var status = -1;
var selectionLog = [];

function action(d, h, j) {
    if (status == 0 && d == 0) {
        cm.dispose();
        return
    }
    status++;
    selectionLog[status] = j;
    var c = -1;
    if (status <= c++) {
        cm.dispose()
    } else {
        if (status === c++) {
            var g = ["mirrorD_321_0_", "mirrorD_321_1_", "mirrorD_321_2_", "mirrorD_321_3_"];
            var a = [0, 0, 0, 0];
            var b = ["看似美丽，但其实栖息着凶恶怪物的米纳尔西部森林。", "森林支配者半人马王所支配的米纳尔东部森林。", "被西下的太阳染红的黄昏森林。", "飞龙在险峻的岩石之间筑巢的飞龙峡谷。"];
            var f = new Array();
            var e = 41800 + parseInt((cm.getMapId() - 320000000) / 1000000) * 4 - 4;
            for (var c = 0; c < b.length; c++) {
                if (cm.getNumberFromQuestInfo(e + c, "count") > 0) {
                    f.push(b[c] + "\n\n通关次数:" + cm.getNumberFromQuestInfo(e + c, "count") + "\r\n最短纪录:" + cm.getNumberFromQuestInfo(e + c, "min") + "分 " + cm.getNumberFromQuestInfo(e + c, "sec") + "秒")
                } else {
                    f.push(b[c] + "\n\n通关次数:- \r\n最短纪录:-分 -秒")
                }
            }
            if (cm.isQuestActive(40053)) {
                g.push("map321190200");
                a.push(0);
                f.push("贤明的玛瑙龙阿弗利埃的巢穴。")
            }
            if (cm.isQuestFinished(40054) && cm.getQuestStatus(40061) == 0) {
                g.push("map321190300");
                a.push(0);
                f.push("可以见到暗黑龙王的发光洞穴")
            }
            cm.setMirrorDungeonInfo(g, a, f);
            cm.dispose()
        }
    }
}

function start() {
    status = -1;
    action(1, 0, 0)
};